<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="number" v-model.number="num1">+
        <input type="number" v-model.number="num2">={{sum}}
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                num1:1,
                num2:2,
            },
            computed:{
                sum(){
                    console.log("hello")
                    return this.num1+this.num2
                }
            },
            beforeUpdate() {
                console.log(5)
            },
            updated() {
                console.log(6)
            },
            //5,hello,6
        })
    </script>
</body>
</html>